package com.wanng.quartz.tools;


import java.text.SimpleDateFormat;
import java.util.Date;

public class SDFUtil {

    private static final String DEFAULT_PATTERN = "yyyy-MM-dd HH:mm:ss";
    private static final ThreadLocal<SimpleDateFormat> dateFormatThreadLocal = ThreadLocal.withInitial(() -> new SimpleDateFormat(DEFAULT_PATTERN));

    public static String formatDate(Date date) {
        return dateFormatThreadLocal.get().format(date);
    }
}
